package com.cgmnx.admin.service;

import com.cgmnx.admin.common.bean.Limiter;
import com.cgmnx.admin.dao.condition.ReplyCondition;
import com.cgmnx.admin.dao.entity.ReplyEntity;
import com.cgmnx.admin.dao.mapper.ReplyMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zippoy
 * 2018-04-23
 * @since 1.0.0
 */
@Service
public class ReplyServiceImpl implements ReplyService {

     @Resource
    private ReplyMapper replyMapper;

    @Override
    public void save(ReplyEntity entity) {
        replyMapper.save(entity);
    }

    @Override
    public List<ReplyEntity> queryPage(ReplyCondition condition,Limiter limiter) {
        return replyMapper.queryPage(condition, limiter);
    }

    @Override
    public int count(ReplyCondition condition) {
        return replyMapper.count(condition);
    }

    @Override
    public ReplyEntity queryById(Integer id) {
        return replyMapper.queryById(id);
    }

    @Override
    public void updateAudit(Integer id, Integer newStatus, Integer oldStatus) {
        replyMapper.updateAudit(id, newStatus, oldStatus);
    }

}
